home *** CD-ROM | disk | FTP | other *** search
- /*
- File: BigEasy2.h
-
- Contains: xxx put contents here xxx
-
- Written by: xxx put writers here xxx
-
- Copyright: © 1990-1991 by Apple Computer, Inc., all rights reserved.
-
- This file is used in these builds: Warhol
-
- Change History (most recent first):
-
- <13> 8/25/91 JB Changed #def Ticks to #def GetTicks
- <12> 6/3/91 dvb Just hackin.
- <11> 5/28/91 JB Added prototypes for BigEasy Proc Ptrs
- <10> 5/25/91 JB OLD_THINK_C && TOOLBOX_LINKED
- <9> 5/23/91 PH functions..
- <8> 5/5/91 dvb App Open Events
- <7> 4/25/91 JB Changing to new THINK C interface files
- <6> 4/19/91 dvb Add WindowEventProc
- <5> 2/24/91 dvb Various cool new calls
- <4> 2/18/91 dvb Miscellaneous Updates
- <3> 2/6/91 JB Made nil #define conditional
- <2> 11/17/90 dvb Remove subport machinery
- <4> 9/19/90 dvb Fix graphics math collision
- <3> 9/10/90 dvb Take Zoomproc out of InstallWindow call.
- <2> 7/31/90 dvb Modify inclusion hierarchy
-
- To Do:
- */
-
- /* file: BigEasy2.h
- *
- * Started 4 July 1989, more or less.
- *
- * A set of routines to allow the quick development
- * of simple Macintosh applications.
- *
- */
-
- #ifndef BigEasyIncludes
- #define BigEasyIncludes
-
- #include <Types.h>
- #include <Menus.h>
- #include <AppleEvents.h>
-
- /************************************
- * Simple things
- ************************************/
-
- #if THINK_C < 5
- typedef void (*beUpdateProcPtr)(); /* Function Pointer */
- typedef void (*beClickProcPtr)(); /* Function Pointer */
- typedef void (*beKeyProcPtr)(); /* Function Pointer */
- typedef void (*beGoAwayProcPtr)(); /* Function Pointer */
- typedef void (*beZoomProcPtr)(); /* Function Pointer */
- typedef void (*beActivateProcPtr)(); /* Function Pointer */
- typedef void (*beDeactivateProcPtr)(); /* Function Pointer */
- typedef void (*beIdleProcPtr)(); /* Function Pointer */
- typedef void (*beResizeProcPtr)(); /* Function Pointer */
- typedef void (*beGrowWindowProcPtr)(); /* Function Pointer */
- typedef void (*beEventProcPtr)(); /* Function Pointer */
- typedef void (*beMenuProcPtr)(); /* Function Pointer */
-
- typedef void (*beAboutProcPtr)();
- typedef void (*beWNumCallProcPtr)();
- #else
- typedef void (*beUpdateProcPtr)(short windowNum);
- typedef void (*beClickProcPtr)(short windowNum, Point p, short modifiers);
- typedef void (*beKeyProcPtr)(short windowNum, short key, short keycode, short modifiers);
- typedef void (*beGoAwayProcPtr)(short windowNum);
- typedef void (*beZoomProcPtr)(short windowNum);
- typedef void (*beActivateProcPtr)(short windowNum);
- typedef void (*beDeactivateProcPtr)(short windowNum);
- typedef void (*beIdleProcPtr)(short windowNum, Boolean upfront);
- typedef void (*beResizeProcPtr)(short windowNum, Point *oldSize, Point *newSize, short modifiers);
- typedef void (*beGrowWindowProcPtr)(long *newSize, short windowNum,
- WindowPtr w, Point where, Rect *resizeLim);
- typedef void (*beEventProcPtr)(short windowNum, EventRecord *event, Boolean *tookEvent);
- typedef void (*beMenuProcPtr)(short windowNum, short menuItem, short menuRef);
-
- typedef void (*beAboutProcPtr)(void);
- typedef void (*beWNumCallProcPtr)(short windowNum);
- #endif
-
-
- #ifndef mathTypesIncludes
- typedef Boolean boolean;
- #endif
-
- #ifndef nil
- #define nil (0L)
- #endif
-
- #define SwapShort(a,b) {short temp; temp = a; a = b; b = temp;}
-
-
- /************************************
- * Types
- ************************************/
-
- /*
- * Window Flags (as passed to InstallWindow)
- */
- typedef enum
- {
- wGrowable = 1,
- wZoomable = 2,
- wCoolDrag = 4 /* Set to do the really cool live-dragwindow trick */
- };
-
- /*
- * Built in menu ref-numbers
- */
- typedef enum
- {
- mUndo = 30000,
- mCut,
- mCopy,
- mPaste,
- mClear
- };
-
- /************************************
- * BigEasy2 Public Global Variables
- ************************************/
- #ifdef BigEasy2
- #define VAR
- #else
- #define VAR extern
- #endif
-
- VAR boolean gQuitApp;
- VAR boolean gMenuNeedsCmdKey;
- VAR boolean gStaggerWindows;
- VAR short gLastModifiers;
-
-
- VAR Rect gBigRect;
-
- #ifndef __QUICKDRAW__
- #include <QuickDraw.h>
- #endif
-
- #ifndef __WINDOWS__
- #include <Windows.h>
- #endif
-
- #undef VAR
-
-
- /************************************
- * Major BigEasy2 Routines
- ************************************/
-
- WindowPtr InstallWindow(short iNum,StringPtr iTitle,Rect *iRect,short iType,short newFlags,
- beUpdateProcPtr iUpdate,beClickProcPtr iClick,beKeyProcPtr iKey,beGoAwayProcPtr iGoAway,
- beActivateProcPtr iActivate,beDeactivateProcPtr iDeactivate,beIdleProcPtr iIdle);
-
- void UninstallWindow(short iNum);
-
- void Show(short inum);
- void Hide(short iNum);
-
- MenuHandle InstallMenu(StringPtr s,beMenuProcPtr action,short ref);
- void InstallMenuItem(StringPtr s,beMenuProcPtr action,short ref);
- void DeleteMenuItem(short ref);
- void SetMenuItem(short ref,char enable,char isMarked,char mark,StringPtr s);
- void EnDisEdits(short Eundo,short Ecut,short Ecopy,short Epaste,short Eclear);
- void InstallEditMenu(beWNumCallProcPtr,beWNumCallProcPtr,beWNumCallProcPtr,beWNumCallProcPtr,beWNumCallProcPtr);
- void SetCurrentMenu(short ref);
-
- void SetMasterIdle(beAboutProcPtr);
- void IdleWindow(short n);
-
- void SetMasterOpenAppMessage(EventHandlerProcPtr);
- void SetMasterOpenDocMessage(EventHandlerProcPtr);
- /*
- void SetMasterPrintDocMessage(FP);
- void SetMasterQuitMessage(FP);
- */
-
- void SetWindowResizeProc(short n,beResizeProcPtr resizeProc);
- void SetWindowGrowWindowProc(short n,beGrowWindowProcPtr growWindowProc);
- void SetWindowZoomProc(short n,beZoomProcPtr iZoom);
- void SetWindowEventProc(short n, beEventProcPtr iEvent);
- long GetWindowFlags(short n);
- void SetWindowFlags(short n,long flags);
-
- void GetWindowRect(short n,Rect *r);
- WindowPtr GetWindowPtr(short n);
- boolean GetWindowVisible(short n);
- void Replace1Resource(Handle,long type,short id);
- void SaveWindowPosition(short n);
- void ForgetWindowPosition(short n);
-
- void SetAbout(StringPtr progName,StringPtr s0,beAboutProcPtr aboutProc);
-
- void GoWatch(void);
- void GoArrow(void);
- void GoCursor(short c);
-
- void FailNil(long);
- void FailOSErr(long);
-
- /************************************
- * Client Provided BigEasy2 Routines
- ************************************/
-
- void Bootstrap(void);
- void Hatstrap(void);
-
-
- /************************************
- * Minor BigEasy2 Hacks
- ************************************/
- #ifndef BigEasy2
- #define FailNil(x) FailNil((long)(x)) /* Simulate a typeless call */
- #define FailOSErr(x) FailOSErr((long)(x)) /* Simulate a typeless call */
- #endif
-
- #define GetTicks() (*(long *)Ticks)
-
- #endif